<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: zzf
  Date: 2021/1/8
  Time: 15:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <form action="${pageContext.request.contextPath}/emp/updateEmp" method="post">
        <input type="hidden" name="empId" value="${requestScope.employee.empId}" />
        <input type="hidden" name="ssn" value="${requestScope.employee.ssn}" />
        员工姓名：<input type="text" name="empName" value="${requestScope.employee.empName}"/><br/>
        社会保险号：${requestScope.employee.ssn}<br/>
        所在部门：
        <select name="department.deptId">
            <c:forEach items="${requestScope.deptList}" var="dept">
                <c:if test="${requestScope.employee.department.deptId == dept.deptId}">
                    <option value="${dept.deptId}" selected="selected">${dept.deptName}</option>
                </c:if>
                <c:if test="${requestScope.employee.department.deptId != dept.deptId}">
                    <option value="${dept.deptId}">${dept.deptName}</option>
                </c:if>
            </c:forEach>
        </select>
        <br><br>
        <button type="submit">更新</button>
    </form>
</body>
</html>
